home *** CD-ROM | disk | FTP | other *** search
- ATARI MACHINE SPECIFIC LIBRARY
-
-
-
- NAME
- Resolution - support for the currently defined Atari resolutions
-
- SYNOPSIS
- #include <Resolution.h>
-
- class Resolution
-
- extern const Resolution STLow;
- extern const Resolution STMedium;
- extern const Resolution STHigh;
-
- extern const Resolution TTLow;
- extern const Resolution TTMedium;
- extern const Resolution TTHigh;
-
-
- DESCRIPTION
- When writing machine specific graphical programs, the Atari
- programmer may prefer to increase efficiency by coding specifically
- for one or more of the computer's resolutions. For example, games
- are often written to support only colourful resolutions.
-
- The start-up resolution is always restored upon termination.
-
- Note that the resolutions of the Falcon030 are not yet supported,
- but that this module has been designed with extensions for that
- machine in mind. Support will be available as soon as an author
- has a Falcon030!
-
- CLASSES
- A Resolution is a (Width,Height,Depth) triple. Width is the
- number of pixels in the horizontal dimension (ie. number of columns).
- Height is the number of pixels in the vertical dimension (ie. the number
- of lines). Depth is the number of bitplanes. A resolution will have
- a number of colours equal to 2 to the power of the number of bitplanes
- (colours = power(2,bitplanes)).
-
- CLASS MEMBERS
- Resolution::
- Resolution()
- - Creates a Resolution equal to the resolution currently in use.
- (because of start-up conditions or because of another Resolution
- beging "Used")
-
- Resolution(int width, int height, int depth)
- - Create a Resolution with the given attributes.
-
- int Width() const
- int Height() const
- int Depth() const
- - Examine resolution properties.
-
- void Use() const
- - Mofiy the system to enable this resolution.
-
- short BitPlanes() const
- - Equivalent to Depth().
-
- short BytesPerBitPlaneLine() const
- - The amount of memory used by one line of a single bitplane.
-
- short BytesPerLine() const
- - The amount of memory used by one line of all bitplanes.
-
- int NumberOfColours() const
- - The number of colours - power(2,Depth()), but efficient.
-
- int operator==(const Resolution&) const
- int operator!=(const Resolution& R) const
- - Compare resolutions. They are considered equal if the
- (Width,Height,Depth) components are equal.
-
- The following functions should be avoided. They are only intended
- to simplify implementation of old-style resolutions - where a "mode"
- of 0, 1, 2, etc. determined the (Width,Height,Depth) values. This
- is not feasible on the Falcon030.
-
- Resolution(short)
- short OldMode() const
- - as per Getrez(), but -1 if not possible.
-
-
- USAGE
- When a program only supports certain resolutions, the programmer
- should either change to an appropriate resolution, or warn the
- user and exit.
-
- Note that if you attempt to change to a colour resolution on an
- Atari ST[e] while in monochrome, the computer will reboot. On the
- TT, the change occurs fine, but the general approach should be to
- never automatically change to ANY resolution when starting in STHigh
- or even perhaps TTHigh (which also uses a non-colour monitor).
-
- EXAMPLES
- A sample start to a program may be:
-
- {
- Resolution InitialResolution;
-
- // Only support the 16-colour modes
- if (InitialResolution == STHigh || InitialResolution == TTHigh) {
- printf("Sorry, only 16-colour modes\n");
- exit(1);
- }
-
- if (InitialResolution == TTLow)
- TTMedium.Use();
- else if (InitialResolution != TTMedium)
- STLow.Use();
-
- ...
- }
-
-
- SEE ALSO
- Screen
-
- BUGS
- GEM/AES still ignores resolution changes.
- Note that due to the fascist way TOS changes resolution, the current
- logical screen is cleared when the current resolution is changed.
-
- AUTHOR
- Warwick Allison, 1992.
- warwick@cs.uq.oz.au
-
- COPYING
- This functionality is part of the Atari Machine Specific Library,
- and is Copyright 1992 by Warwick W. Allison.
-
- The Atari Machine Specific Library is free and protected under the
- GNU Library General Public License.
-
- You are free to copy and modify these sources, provided you acknowledge
- the origin by retaining this notice, and adhere to the conditions
- described in the GNU LGPL.
-